﻿using FluentNHibernate.Mapping;
using SimpleScrum.Core.Entities;

namespace SimpleScrum.Core.Mappings
{
    public class BackLogMap : ClassMap<BackLog>
    {
        public BackLogMap()
        {
            Table("BackLog");
            LazyLoad();
            Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
            References(x => x.Sprint).Column("SprintId").Cascade.All();
            References(x => x.UserStory).Column("UserStoryId").Cascade.All();
            References(x => x.Project).Column("ProjectId").Cascade.All();
            Map(x => x.Tags).Column("Tags");
            Map(x => x.AssignDate).Column("AssignDate").Not.Nullable();
            Map(x => x.Status).Column("StatusId").Not.Nullable();
            Map(x => x.Title).Column("Title").Not.Nullable();
        }
    }
}